<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
               v-model="form"
               :defaults.sync="showColumn"
               :permission="permissionList"
               :page.sync="page"
               :before-open="beforeOpen"
               @sortable-change="sortableChange"
               @row-del="rowDel"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @refresh-change="refreshChange"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @filter="filterChange"
               @sort-change="sortChange"
               @row-dblclick="handleRowDBLClick"               
               @on-load="onLoad">
      <template slot-scope="scope" slot="menu">
        <el-button type="text"
                   size="small"
                   icon="el-icon-sort"
                   v-if="permission.biz_apparch_sys_function_edit"
                   @click.stop="openVersionFromAssetDialog(scope.row)">所有版本
        </el-button>
      </template>
      <template slot-scope="scope" slot="assetFlag">
        <div>
          <el-tag v-if="scope.row.assetFlag != '1'" type="info">否</el-tag>
          <el-tag v-if="scope.row.assetFlag == '1'" type="success">是</el-tag>
        </div>
      </template>
      <template slot-scope="scope" slot="menuForm">
        <div  style="text-align:right; float:right">
          <el-button type="text" v-if="operateType == 'edit'"  icon="el-icon-time" style="font-weight:normal;" size="large" @click.stop="getHistoryRecord">修改历史</el-button>
        </div> 
      </template>
      <template slot-scope="scope" slot="menuLeft">
        <el-button type="primary"
                   size="small"
                   icon="el-icon-plus"
                   v-if="permission.biz_apparch_sys_function_batch_add"
                   @click.stop="openAddFromAssetDialog">从资产新增
        </el-button>
        <el-button type="primary"
                   size="small"
                   icon="el-icon-sort"
                   v-if="permission.biz_apparch_sys_function_edit"
                   @click.stop="openSortDialog">功能点排序
        </el-button>
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   v-if="permission.biz_apparch_sys_function_batch_delete"
                   @click.stop="handleDelete">删 除
        </el-button>
      </template>
      <template slot="menuRight">
        <el-button v-if="permission.biz_apparch_sys_function_download-1" type="default" @click.stop="exportExcel"  title="下载" icon="el-icon-download" circle size="small"></el-button>
      </template>
    </avue-crud>
    <!-- 
      拖动排序对话框
     -->
    <el-dialog class="sortClass" title="拖动排序" width='60%' :append-to-body='true' :close-on-click-modal='false' :visible.sync="sortDialog">
      <avue-crud   :option="sortOption" 
                    :data="sortData"
                    ref="sortCrud"
                    v-model="sortForm"
                    @row-update="cloumnAddUpdate"
                    @sortable-change="cloumnSaveOrUpdate"
                    >
      </avue-crud>
      <div slot="footer" class="dialog-footer">
        <el-button size="small" type="primary" id="copyBtn" @click="saveSortData($event)" data-clipboard-target="#pathText">确定</el-button>
        <el-button size="small" @click="sortDialog = false">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 
      业务功能点资产选择对话框
     -->
    <el-dialog :title="assetTitle" width='90%' top='5vh' :close-on-click-modal='false' :modal='true' :append-to-body='true'  :visible.sync="addFromAssetDialog">
      <biz-apparch-system-function-list-selector
      :functionType = 'functionType'
      :systemFunctionData = 'systemFunctionData'
      @addToSystemFunctionList = 'addToSystemFunctionList'
      @changeSystemFunctionVersion = 'changeSystemFunctionVersion'
      >
    </biz-apparch-system-function-list-selector>
    </el-dialog>
    <!-- 历史记录 -->
    <update-history ref="historyRecord"></update-history>
  </basic-container>
</template>

<script>
import {queryBizApparchBizFunctionListPage} from '@/api/biz/apparch/bizApparchBizFunctionApi';
import {queryBizApparchSystemListPage} from '@/api/biz/apparch/bizApparchSystemApi';
import {queryBizApparchOutSystemListPage} from '@/api/biz/apparch/bizApparchOutSystemApi';

import {exportBizApparchSystemFunctionExcel,saveOrUpdateBizApparchSystemFunction,saveOrUpdateBizApparchSystemFunctionList,saveBizApparchSystemFunction,saveBizApparchSystemFunctionList,deleteBizApparchSystemFunction,queryBizApparchSystemFunction,queryBizApparchSystemFunctionListPage,updateBizApparchSystemFunction,deleteBizApparchSystemFunctionList} from '@/api/biz/apparch/bizApparchSystemFunctionApi';
import {mapGetters} from 'vuex';
import { reqCommonMsg } from '@/util/reqCommonMsg';
import BizApparchSystemFunctionListSelector from '@/views/biz/apparch/bizApparchSystemFunctionListSelector';

export default {
  components:{
    BizApparchSystemFunctionListSelector
  }, 
  props: {
    bizFunctionData: {
      type: Object,
      default: ''
    }
  },
  data() {
    return {
      //文件选择器的打开方式 add新增、edit修改、view 查看
      openType: 'edit',
      
      // 当前打开form对话框操作类型 
      operateType: 'add',


      // 从资产中添加对话框
      addFromAssetDialog: false,
      functionType: 'add',
      systemFunctionData: {},
      assetTitle: '从系统功能点资产中选择',

      // 是否拆分到系统功能点
      isSplitSystemFunction: false,

      //修改记录对话框
      historyDialog: false,

      //如果做流程表单 请将次开关设置为true，否则设置为false
      isFlow: true,
      flowArea: {},

      //排序设置
      sortDialog: false,
      sortForm: {},
      sortData: [],
      sortOption:{
        columnBtn: false,
        addBtn: false,
        delBtn: false,
        editBtn:false,
        viewBtn: false,
        refreshBtn: false,
        sortable:true,
        dragHandler:true,
        addBtn:false,
        menu:false,
        align:'center',
        index: true,
        column: [{
          label: '系统功能点编号',
          prop: 'systemFunctionNo',
        }, 
        {
          label: '系统功能点名称',
          prop: 'systemFunctionName', 
        }]
      },

      // 控制选择内部系统 还是外联系统
      selectSystemType: 'innerSystem',

      importDataArea: '',
      batchAddDialog: false,
      form: {},
      currentRow: {},
      selectionList: [],
      loading: true, 
      showColumn: [],
      option: {
        labelPosition: 'right',
        labelSuffix: '：',
        labelWidth: 140,
        dialogTop: '50',
        indexFixed:true, 
        stripe:true,
        calcHeight: 80,
        searchShow: false,
        searchBtn: false,
        searchMenuSpan: 6,
        tip: false,
        border: true,
        index: true,
        selection: true,
        addBtn: true,
        viewBtn: false,
        delBtn: true,
        cancelBtn: true,
        printBtn:false,
        saveBtn: true,
        filterBtn:false,
        columnBtn: false,          
        menuWidth: 220,
        dialogMenuPosition: 'center',
        dialogDirection:'rtl',
        dialogType:'dialog',
        dialogFullscreen:false,
        dialogClickModal:false,
        dialogWidth: '70%',
        highlightCurrentRow:  true,
        column: [
          {
            label: '业务功能点编号',
            prop: 'bizFunctionNo', 
            type: 'input', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 125,
            multiple: false,
            span: 12,
            sortable: false,
            hide: true,
            width:180,
            disabled: true,
          }, 
          {
            label: '业务功能点名称',
            prop: 'bizFunctionName', 
            type: 'input', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 125,
            multiple: false,
            span: 12,
            sortable: false,
            hide: true,
            maxlength: 50,
            overHidden: true,
            width:200,
            disabled: true
          },
          {
            label: '系统编号',
            prop: 'systemNo', 
            type: 'table', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            sortable: false,
            hide: true,
            display: false,
            width:180,
            children: {
              border: true,
              column: [
                {
                  label: '系统/模块类别',
                  prop: 'systemCategory', 
                  type: 'select', 
                  search: false,
                  searchMmultiple: false,
                  searchLabelWidth: 120,
                  multiple: false,
                  span: 12,
                  sortable: false,
                  hide: false,
                },
                {
                  label: '系统/模块编号',
                  prop: 'id', 
                  type: 'input', 
                  search: false,
                  searchMmultiple: false,
                  searchLabelWidth: 120,
                  multiple: false,
                  span: 12,
                  sortable: false,
                  hide: false,
                },
                {
                  label: '系统/模块名称',
                  prop: 'systemName', 
                  type: 'input', 
                  search: false,
                  searchMmultiple: false,
                  searchLabelWidth: 120,
                  multiple: false
                },
                {
                  label: '系统/模块简称',
                  prop: 'systemShortName', 
                  type: 'input', 
                  search: false,
                  searchMmultiple: false,
                  searchLabelWidth: 120,
                  multiple: true,
                }
              ],
            },
            formatter: (row) => {
              if(row.systemFunctionNo) {
                return row.systemNo;
              }
              else if(row.id){
                this.form.systemName = row.systemName;
                this.form.systemNo = row.id;
                this.form.projectId = row.projectId;
                this.form.projectName = row.projectName;
                return row.id
              }
              else{
                return '';
              }
            },
            onLoad: ({ page, value,data }, callback) => {
              
              //首次加载去查询对应的值
              if (value) {
                //this.singleBody.projectId = this.projectInfo.id;
                this.reqParams =  {
                  singleBody: {
                    id: value
                  },
                  listBody: [{}],
                  sqlCondition: this.conditions,
                  currentPage: 1, 
                  pageSize: 10
                }
                this.commonData = reqCommonMsg(this.reqParams)
               
                queryBizApparchSystemListPage(this.commonData).then(res => {
                  let returnData = [];
                  const data = res.data.body;
                  this.formPage.total = data.total;
                  data.listBody.forEach((element,index) => {
                    if(index == 0){
                      returnData = {
                        id: element.id,
                        systemCategory: element.systemCategory,
                        systemShortName: element.systemShortName,
                        systemName: element.systemName,
                        projectId: element.projectId,
                        projectName: element.projectName,
                        versionNo: element.versionNo,
                      }
                    }
                  });
                  callback(returnData)
                  return
                }, error => {
                }); 
                //callback()
                return
              }
              let searchValue = {};
              if(data){
                searchValue = data
              }
              if(page){
                this.formPage = page;
              }
              //分页查询信息
              
              //this.singleBody.projectId = this.projectInfo.id;
              this.reqParams =  {
                singleBody: searchValue,
                listBody: [{}],
                sqlCondition: this.conditions,
                currentPage: this.formPage.currentPage, 
                pageSize: this.formPage.pageSize
              }
              this.commonData = reqCommonMsg(this.reqParams)
              
              queryBizApparchSystemListPage(this.commonData).then(res => {
                let returnData = [];
                const data = res.data.body;
                this.formPage.total = data.total;
                data.listBody.forEach(element => {
                  returnData.push({
                    id: element.id,
                    systemCategory: element.systemCategory,
                    systemShortName: element.systemShortName,
                    systemName: element.systemName,
                    projectId: element.projectId,
                    projectName: element.projectName,
                    versionNo: element.versionNo,
                  })
                });
                callback({
                  total: this.formPage.total,
                  data: returnData
                })
                return
              }, error => {
              });
              
            },
            props: {
              label: 'systemName',
              value: 'id'
            },
            rules: [
              {
                message: '请输入内容',
                required:  true,
              },
              {
                max: 30,
                message: '内容长度不能超过30字符',
              }
            ]
          }, 
          {
            label: '外联系统编号',
            prop: 'outSystemNo', 
            type: 'table', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            sortable: false,
            hide: true,
            display: true,
            children: {
              border: true,
              column: [
                {
                  label: '系统/模块类别',
                  prop: 'systemCategory', 
                  type: 'select', 
                  search: false,
                  searchMmultiple: false,
                  searchLabelWidth: 120,
                  multiple: false,
                  span: 12,
                  sortable: false,
                  hide: false,
                },
                {
                  label: '系统/模块编号',
                  prop: 'id', 
                  type: 'input', 
                  search: false,
                  searchMmultiple: false,
                  searchLabelWidth: 120,
                  multiple: false,
                  span: 12,
                  sortable: false,
                  hide: false,
                },
                {
                  label: '系统/模块名称',
                  prop: 'systemName', 
                  type: 'input', 
                  search: false,
                  searchMmultiple: false,
                  searchLabelWidth: 120,
                  multiple: false
                },
                {
                  label: '系统/模块简称',
                  prop: 'systemShortName', 
                  type: 'input', 
                  search: false,
                  searchMmultiple: false,
                  searchLabelWidth: 120,
                  multiple: true,
                }
              ],
            },
            formatter: (row) => {
              if(row.systemFunctionNo) {
                return row.systemNo;
              }
              else if(row.id){
                this.form.systemName = row.systemName;
                this.form.systemNo = row.id;
                this.form.projectId = row.projectId;
                this.form.projectName = row.projectName;
                return row.id
              }
              else{
                return '';
              }
            },
            onLoad: ({ page, value,data }, callback) => {
              
              //首次加载去查询对应的值
              if (value) {
                //this.singleBody.projectId = this.projectInfo.id;
                this.reqParams =  {
                  singleBody: {
                    id: value
                  },
                  listBody: [{}],
                  sqlCondition: this.conditions,
                  currentPage: 1, 
                  pageSize: 10
                }
                this.commonData = reqCommonMsg(this.reqParams)
                
                queryBizApparchOutSystemListPage(this.commonData).then(res => {
                  let returnData = [];
                  const data = res.data.body;
                  this.formPage.total = data.total;
                  data.listBody.forEach((element,index) => {
                    if(index == 0){
                      returnData = {
                        id: element.id,
                        systemCategory: element.systemCategory,
                        systemShortName: element.systemShortName,
                        systemName: element.systemName,
                        projectId: element.projectId,
                        projectName: element.projectName,
                        versionNo: element.versionNo,
                      }
                    }
                  });
                  callback(returnData)
                  return
                }, error => {
                }); 
                //callback()
                return
              }
              let searchValue = {};
              if(data){
                searchValue = data
              }
              if(page){
                this.formPage = page;
              }
              //分页查询信息
              
              //this.singleBody.projectId = this.projectInfo.id;
              this.reqParams =  {
                singleBody: searchValue,
                listBody: [{}],
                sqlCondition: this.conditions,
                currentPage: this.formPage.currentPage, 
                pageSize: this.formPage.pageSize
              }
              this.commonData = reqCommonMsg(this.reqParams)
               
              queryBizApparchOutSystemListPage(this.commonData).then(res => {
                let returnData = [];
                const data = res.data.body;
                this.formPage.total = data.total;
                data.listBody.forEach(element => {
                  returnData.push({
                    id: element.id,
                    systemCategory: element.systemCategory,
                    systemShortName: element.systemShortName,
                    systemName: element.systemName,
                    projectId: element.projectId,
                    projectName: element.projectName,
                    versionNo: element.versionNo,
                  })
                });
                callback({
                  total: this.formPage.total,
                  data: returnData
                })
                return
              }, error => {
              });
            },
            props: {
              label: 'systemName',
              value: 'id'
            },
            rules: [
              {
                message: '请输入内容',
                required:  true,
              },
              {
                max: 30,
                message: '内容长度不能超过30字符',
              }
            ]
          }, 
          {
            label: '系统名称',
            prop: 'systemName', 
            type: 'input', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            sortable: false,
            hide: false,
            maxlength: 50,
            overHidden: true,
            disabled: true,
            width:200,
            rules: [{
              message: '请输入系统名称',
              required:  false,
              trigger: 'blur'
            },
            {
              max: 50,
              message: '内容长度不能超过50字符',
              trigger: 'blur'
            }],
            dicData:[],
          },
          {
            label: '系统类型',
            prop: 'systemType', 
            type: 'radio', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            sortable: false,
            hide: true,
            maxlength: 30,
            overHidden: true,
            value: 'innerSystem',
            rules: [{
              message: '请输入功能点类型',
              required:  true,
              trigger: 'blur'
            },
            {
              max: 30,
              message: '内容长度不能超过30字符',
              trigger: 'blur'
            }],
            dicData:[
              {
                label: '内部系统',
                value: 'innerSystem'
              },
              {
                label: '外联系统',
                value: 'outSystem'
              }
            ],
            change: ({value,column}) => {
              this.selectSystemType = value;
              if(value == 'innerSystem'){
                this.findObject(this.option.column, 'systemNo').display = true;
                this.findObject(this.option.column, 'outSystemNo').display = false;
              }
              else {
                this.findObject(this.option.column, 'systemNo').display = false;
                this.findObject(this.option.column, 'outSystemNo').display = true;
              }
            }
          },
          {
            label: '功能点类型',
            prop: 'functionType', 
            type: 'select', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            sortable: false,
            hide: true,
            maxlength: 30,
            overHidden: true,
            rules: [{
              message: '请输入功能点类型',
              required:  true,
              trigger: 'blur'
            },
            {
              max: 30,
              message: '内容长度不能超过30字符',
              trigger: 'blur'
            }],
            dicData:[],
          },
          {
            label: '系统功能点编号',
            prop: 'systemFunctionNo', 
            type: 'input', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 125,
            multiple: false,
            span: 24,
            sortable: false,
            hide: false,
            maxlength: 50,
            overHidden: true,
            width:180,
            display: false,
            rules: [{
              message: '请输入系统功能点编号',
              required:  true,
              trigger: 'blur'
            },
            {
              max: 50,
              message: '内容长度不能超过50字符',
              trigger: 'blur'
            }],
            dicData:[],
          },
          {
            label: '系统功能点名称',
            prop: 'systemFunctionName', 
            type: 'input', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 125,
            multiple: false,
            span: 24,
            sortable: false,
            hide: false,
            maxlength: 50,
            overHidden: true,
            width:200,
            rules: [{
              message: '请输入系统功能点名称',
              required:  true,
              trigger: 'blur'
            },
            {
              max: 50,
              message: '内容长度不能超过50字符',
              trigger: 'blur'
            }],
            dicData:[],
          },
          
          {
            label: '功能点序号',
            prop: 'systemFunctionSeq', 
            type: 'number', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            sortable: false,
            hide: false,
            overHidden: true,
            value: 0,
            maxRows: 100,
            minRows: 0,
            width: 100,
            rules: [{
              message: '请输入系统功能点序号',
              required:  false,
              trigger: 'blur'
            }],
            dicData:[],
          },
          {
            label: '是否改造',
            prop: 'isReformFlag', 
            type: 'select', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            sortable: false,
            hide: true,
            maxlength: 1,
            overHidden: true,
            value: '否',
            rules: [{
              message: '请输入是否改造标志',
              required:  false,
              trigger: 'blur'
            },
            {
              max: 1,
              message: '内容长度不能超过1字符',
              trigger: 'blur'
            }],
            dicData:[
              {
                label: '否',
                value: '否'
              },
              {
                label: '是',
                value: '是'
              }
            ],
          },
          {
            label: '变更日期',
            prop: 'changeDate', 
            type: 'date', 
            format:'yyyy-MM-dd',
            valueFormat: 'yyyy-MM-dd',
            value: this.$toolUtil.formatDate(new Date()),
            pickerOptions: {
              disabledDate(time) {
                return time.getTime() + 3600 * 1000 * 24 <= Date.now();
              }
            },
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            sortable: false,
            hide: true,
            maxlength: 20,
            overHidden: true,
            showColumn: false,
            rules: [{
              message: '请输入变更日期',
              required:  false,
              trigger: 'blur'
            },
            {
              max: 20,
              message: '内容长度不能超过20字符',
              trigger: 'blur'
            }],
            dicData:[],
          },
          {
            label: '当前版本号',
            prop: 'newVersionNo', 
            type: 'input', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            sortable: false,
            hide: false,
            maxlength: 30,
            width: 110,
            overHidden: true,
            value: this.$toolUtil.formatDateToYyyyMmDd(new Date()),
            disabled: true,
            rules: [{
              message: '请输入版本号',
              required:  true,
              trigger: 'blur'
            },
            {
              max: 30,
              message: '内容长度不能超过30字符',
              trigger: 'blur'
            }],
            dicData:[],
          },
           
          {
            label: '资产标志',
            prop: 'assetFlag', 
            type: 'select', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            sortable: false,
            hide: false,
            maxlength: 1,
            overHidden: true,
            display: false,
            slot: true,
            rules: [{
              message: '请输入资产标志',
              required:  false,
              trigger: 'blur'
            },
            {
              max: 1,
              message: '内容长度不能超过1字符',
              trigger: 'blur'
            }],
            dicData:[],
          },
          {
            label: '标签信息',
            prop: 'labelInfo', 
            type: 'dynamic', 
            span: 24,
            children: {
              align: 'center',
              headerAlign: 'center', 
              column: [
                {
                  label: '标签类型',
                  prop: 'labelType',
                  type: 'select',
                  width: 120,
                  rules:[{
                    required:  true,
                    message: '请输入内容',
                  }],
                  dicData: [{
                    label: '测试',
                    value: '测试'
                  }, 
                  {
                    label: '通用',
                    value: '通用'
                  }]
                },
                {
                  label: '标签值',
                  prop: 'labelValues',
                  type: 'select',
                  multiple: true,
                  filterable: true,
                  rules: [{
                    type: 'array',
                    required: true,
                    message: '请输入内容',
                  }],
                  dicData:[],
                }, 
              ]
            }
          },
          {
            label: '接口标志',
            prop: 'interfaceFlag', 
            type: 'switch', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            sortable: false,
            hide: false,
            maxlength: 1,
            overHidden: true,
            rules: [{
              message: '请输入接口标志',
              required:  false,
              trigger: 'blur'
            },
            {
              max: 1,
              message: '内容长度不能超过1字符',
              trigger: 'blur'
            }],
            dicData:[{
              label: '否',
              value: '0'
            }, 
            {
              label: '是',
              value: '1'
            }],
            change: ({value,column}) => {
              if(value == '1'){
                this.option.group[0].display = true;
              }
              else {
                this.option.group[0].display = false;
              }
            }
          },
        ],
        tabs: false,
        menuBtn: true,
        group: [
          {
            display: true,
            arrow: false,
            label: '接口信息',
            prop: 'basicInfo',
            column: [
              {
                label: '接口编号',
                prop: 'interfaceNo', 
                type: 'input', 
                search: false,
                searchMmultiple: false,
                searchLabelWidth: 100,
                multiple: false,
                span: 12,
                sortable: false,
                hide: true,
                maxlength: 30,
                overHidden: true,
                rules: [{
                  message: '请输入接口编号',
                  required:  false,
                  trigger: 'blur'
                },
                {
                  max: 30,
                  message: '内容长度不能超过30字符',
                  trigger: 'blur'
                }],
                dicData:[],
              },
              {
                label: '接口名称',
                prop: 'interfaceName', 
                type: 'input', 
                search: false,
                searchMmultiple: false,
                searchLabelWidth: 100,
                multiple: false,
                span: 12,
                sortable: false,
                hide: true,
                maxlength: 50,
                overHidden: true,
                rules: [{
                  message: '请输入接口名称',
                  required:  false,
                  trigger: 'blur'
                },
                {
                  max: 50,
                  message: '内容长度不能超过50字符',
                  trigger: 'blur'
                }],
                dicData:[],
              },
              {
                label: '服务方接口编号',
                prop: 'serviceInterfaceNo', 
                type: 'table', 
                search: false,
                searchMmultiple: false,
                searchLabelWidth: 100,
                multiple: false,
                span: 12,
                sortable: false,
                hide: true,
                children: {
                  border: true,
                  column: [
                    {
                      label: '系统功能点编号',
                      prop: 'systemFunctionNo', 
                      type: 'input', 
                      search: false,
                      searchMmultiple: false,
                      searchLabelWidth: 120,
                      multiple: false,
                      span: 12,
                      sortable: false,
                      hide: false,
                    },
                    {
                      label: '系统功能点名称',
                      prop: 'systemFunctionName', 
                      type: 'input', 
                      search: false,
                      searchMmultiple: false,
                      searchLabelWidth: 120,
                      multiple: false,
                      span: 12,
                      sortable: false,
                      hide: false,
                    },
                    {
                      label: '接口编号',
                      prop: 'interfaceNo', 
                      type: 'input', 
                      search: false,
                      searchMmultiple: false,
                      searchLabelWidth: 120,
                      multiple: false
                    },
                    {
                      label: '接口名称',
                      prop: 'interfaceName', 
                      type: 'input', 
                      search: false,
                      searchMmultiple: false,
                      searchLabelWidth: 120,
                      multiple: true,
                    }
                  ],
                },
                formatter: (row) => {
                  if(row.bizFunctionNo) {
                    return row.systemNo;
                  }
                  else if(row.id){ 
                    this.form.serviceSystemFunctionName = row.systemFunctionName;
                    this.form.serviceSystemFunctionNo = row.systemFunctionNo;
                    this.form.serviceSystemName = row.systemName;
                    this.form.serviceSystemNo = row.systemNo;
                    this.form.serviceInterfaceNo = row.interfaceNo;
                    this.form.serviceInterfaceName = row.interfaceName;
                    return row.interfaceNo
                  }
                  else{
                    return '';
                  }
                },
                onLoad: ({ page, value,data }, callback) => {
                  //首次加载去查询对应的值
                  if (value) {
                    //this.singleBody.projectId = this.projectInfo.id;
                    this.reqParams =  {
                      singleBody: {
                        interfaceNo: value
                      },
                      listBody: [{}],
                      sqlCondition: this.conditions,
                      currentPage: 1, 
                      pageSize: 10
                    }
                    this.commonData = reqCommonMsg(this.reqParams)
                    queryBizApparchSystemFunctionListPage(this.commonData).then(res => {
                      let returnData = [];
                      const data = res.data.body;
                      this.formPage.total = data.total;
                      data.listBody.forEach((element,index) => {
                        if(index == 0){
                          returnData = {
                            id: element.id,
                            systemFunctionNo: element.systemFunctionNo,
                            systemFunctionName: element.systemFunctionName,
                            systemName: element.systemName,
                            systemNo: element.systemNo,
                            interfaceNo: element.interfaceNo,
                            interfaceName: element.interfaceName,
                            versionNo: element.versionNo,
                          }
                        }
                      });
                      callback(returnData)
                      return
                    }, error => {
                    });
                    //callback()
                    return
                  }
                  let searchValue = {};
                  if(data){
                    searchValue = data
                  }
                  if(page){
                    this.formPage = page;
                  }
                  //分页查询信息
                  searchValue.interfaceFlag = '1';
                  this.reqParams =  {
                    singleBody: searchValue,
                    listBody: [{}],
                    sqlCondition: this.conditions,
                    currentPage: this.formPage.currentPage, 
                    pageSize: this.formPage.pageSize
                  }
                  this.commonData = reqCommonMsg(this.reqParams)
                  queryBizApparchSystemFunctionListPage(this.commonData).then(res => {
                    let returnData = [];
                    const data = res.data.body;
                    this.formPage.total = data.total;
                    data.listBody.forEach(element => {
                      returnData.push({
                        id: element.id,
                        systemFunctionNo: element.systemFunctionNo,
                        systemFunctionName: element.systemFunctionName,
                        systemName: element.systemName,
                        systemNo: element.systemNo,
                        interfaceNo: element.interfaceNo,
                        interfaceName: element.interfaceName,
                        versionNo: element.versionNo,
                      })
                    });
                    callback({
                      total: this.formPage.total,
                      data: returnData
                    })
                    return
                  }, error => {
                  });
                  
                },
                props: {
                  label: 'interfaceName',
                  value: 'interfaceNo'
                },
                rules: [
                  {
                    message: '请输入内容',
                    required:  false,
                  },
                  {
                    max: 30,
                    message: '内容长度不能超过30字符',
                  }
                ]
              }, 
              {
                label: '服务方接口名称',
                prop: 'serviceInterfaceName', 
                type: 'input', 
                search: false,
                searchMmultiple: false,
                searchLabelWidth: 100,
                multiple: false,
                span: 12,
                sortable: false,
                hide: true,
                maxlength: 50,
                overHidden: true,
                disabled: true,
                rules: [{
                  message: '请输入服务方接口名称',
                  required:  false,
                  trigger: 'blur'
                },
                {
                  max: 50,
                  message: '内容长度不能超过50字符',
                  trigger: 'blur'
                }],
                dicData:[],
              },
              
              {
                label: '服务方系统编号',
                prop: 'serviceSystemNo', 
                type: 'input', 
                search: false,
                searchMmultiple: false,
                searchLabelWidth: 100,
                multiple: false,
                span: 12,
                sortable: false,
                hide: true,
                maxlength: 30,
                overHidden: true,
                disabled: true,
                rules: [{
                  message: '请输入服务方系统编号',
                  required:  false,
                  trigger: 'blur'
                },
                {
                  max: 30,
                  message: '内容长度不能超过30字符',
                  trigger: 'blur'
                }],
                dicData:[],
              },
              {
                label: '服务方系统名称',
                prop: 'serviceSystemName', 
                type: 'input', 
                search: false,
                searchMmultiple: false,
                searchLabelWidth: 100,
                multiple: false,
                span: 12,
                sortable: false,
                hide: true,
                maxlength: 50,
                overHidden: true,
                disabled: true,
                rules: [{
                  message: '请输入服务方系统名称',
                  required:  false,
                  trigger: 'blur'
                },
                {
                  max: 50,
                  message: '内容长度不能超过50字符',
                  trigger: 'blur'
                }],
                dicData:[],
              },
              {
                label: '服务方系统状态',
                prop: 'serviceSystemStatus', 
                type: 'input', 
                search: false,
                searchMmultiple: false,
                searchLabelWidth: 100,
                multiple: false,
                span: 12,
                sortable: false,
                hide: true,
                maxlength: 30,
                overHidden: true,
                display: false,
                disabled: true,
                rules: [{
                  message: '请输入服务方系统状态',
                  required:  false,
                  trigger: 'blur'
                },
                {
                  max: 30,
                  message: '内容长度不能超过30字符',
                  trigger: 'blur'
                }],
                dicData:[],
              },
              {
                label: '服务方功能点编号',
                prop: 'serviceSystemFunctionNo', 
                type: 'input', 
                search: false,
                searchMmultiple: false,
                searchLabelWidth: 100,
                multiple: false,
                span: 12,
                sortable: false,
                hide: true,
                maxlength: 30,
                overHidden: true,
                disabled: true,
                rules: [{
                  message: '请输入服务方系统功能点编号',
                  required:  false,
                  trigger: 'blur'
                },
                {
                  max: 30,
                  message: '内容长度不能超过30字符',
                  trigger: 'blur'
                }],
                dicData:[],
              },
              {
                label: '服务方功能点名称',
                prop: 'serviceSystemFunctionName', 
                type: 'input', 
                search: false,
                searchMmultiple: false,
                searchLabelWidth: 100,
                multiple: false,
                span: 12,
                sortable: false,
                hide: true,
                maxlength: 50,
                overHidden: true,
                disabled: true,
                rules: [{
                  message: '请输入服务方系统功能点名称',
                  required:  false,
                  trigger: 'blur'
                },
                {
                  max: 50,
                  message: '内容长度不能超过50字符',
                  trigger: 'blur'
                }],
                dicData:[],
              },
              {
                label: '连接方式',
                prop: 'linkWay', 
                type: 'select', 
                search: false,
                searchMmultiple: false,
                searchLabelWidth: 100,
                multiple: false,
                span: 12,
                sortable: false,
                hide: true,
                maxlength: 30,
                overHidden: true,
                rules: [{
                  message: '请输入连接方式',
                  required:  false,
                  trigger: 'blur'
                },
                {
                  max: 30,
                  message: '内容长度不能超过30字符',
                  trigger: 'blur'
                }],
                dicData:[],
              },
              {
                label: '交互类型',
                prop: 'interactiveType', 
                type: 'select', 
                search: false,
                searchMmultiple: false,
                searchLabelWidth: 100,
                multiple: false,
                span: 12,
                sortable: false,
                hide: true,
                maxlength: 30,
                overHidden: true,
                rules: [{
                  message: '请输入交互类型',
                  required:  false,
                  trigger: 'blur'
                },
                {
                  max: 30,
                  message: '内容长度不能超过30字符',
                  trigger: 'blur'
                }],
                dicData:[],
              },
            ]
          }
        ]
      },
      data: [],
      // 请求参数区
      formPage: {
        pageSize: 10,
        currentPage: 1,
        total: 0
      },
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0
      },
      reqParams: {
        singleBody: {},
        listBody: [{}],
        sqlCondition:[],
        orderRule: [],
        currentPage: 1,
        pageSize: 10
      },
      commonData: null,
      conditions: [],
      orderRules: [],
      singleBody: {}
    };
  },
  computed: {
    ...mapGetters(['website','orgTree','genOrgTree','userInfo','permission','projectInfo']),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.biz_apparch_sys_function_add, false),
        viewBtn: this.vaildData(this.permission.biz_apparch_sys_function_view, false),
        delBtn: this.vaildData(this.permission.biz_apparch_sys_function_delete, false),
        editBtn: this.vaildData(this.permission.biz_apparch_sys_function_edit, false),
        printBtn: this.vaildData(this.permission.biz_apparch_sys_function_print, false),
        searchBtn:this.vaildData(this.permission.biz_apparch_sys_function_search, false)
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach(ele => {
        ids.push({id : ele.id});
      });
      return ids;
    } 
  },
  methods: {
    /**
     * 打开排序窗口
     */
    openSortDialog(){
      this.sortDialog = true;
      this.sortData = this.deepClone(this.data);
    },
    /**
     * 保存排序后的记录
     */
    saveSortData(){ 
      this.sortData.forEach((item, index) => {
        this.sortData[index].systemFunctionSeq = index + 1;
      }); 
      this.reqParams.listBody = this.sortData;
      this.commonData = reqCommonMsg(this.reqParams)
      saveOrUpdateBizApparchSystemFunctionList(this.commonData).then(() => {
        this.$message({
          customClass:'zZindex',
          type: 'success',
          message: '保存成功!'
        });
        this.onLoad(this.page);
        this.sortDialog = false;
      }, error => {
        //this.$console.log(error);
      });
      //this.$console.log('this.sortData = ',JSON.stringify(this.sortData))
    },
    /**
     * 从资产中添加
     */
    openAddFromAssetDialog(){
      this.addFromAssetDialog = true;
      this.functionType = 'add';
      this.assetTitle = '从系统功能点资产中添加';
      this.systemFunctionData = {};
    },
    /**
     * 打开版本列表
     */
    openVersionFromAssetDialog(row){
      this.currentRow = row;
      this.addFromAssetDialog = true;
      this.functionType = 'version';
      this.assetTitle = '所有版本-【'+row.systemFunctionName+'】';
      this.systemFunctionData = row;
    },
    /**
     * 切换版本
     */
    changeSystemFunctionVersion(row){
      let currRow = this.deepClone(row)
      currRow.versionNo =  this.currentRow.versionNo;
      currRow.dataSign =  this.currentRow.dataSign;
      currRow.id =  this.currentRow.id;
      currRow.bizFunctionNo = this.currentRow.bizFunctionNo;
      currRow.bizFunctionName = this.currentRow.bizFunctionName;
      this.reqParams.singleBody = currRow;
      this.commonData = reqCommonMsg(this.reqParams)
      updateBizApparchSystemFunction(this.commonData).then(() => {
        this.singleBody={}
        this.onLoad(this.page);
        this.$message({
          type: 'success',
          message: '操作成功!'
        });
        this.addFromAssetDialog = false;
      }, error => {
      });
    },
    /**s
     * 子组件调用添加
     */
    addToSystemFunctionList(row){
      //是否存在相同的系统功能点记录
      this.reqParams =  {
        singleBody: {
          bizFunctionNo: this.bizFunctionData.bizFunctionNo,
          systemFunctionNo:row.systemFunctionNo,
          versionNo: this.bizFunctionData.versionNo
        }
      }
      let commonData = reqCommonMsg(this.reqParams)
      queryBizApparchSystemFunctionListPage(commonData).then(res => {
        const data = res.data.body;
        if(data.listBody.length == 0)
        {
          this.addNewRow(row);
        }
        else{
          this.$message({
            type: 'warning',
            message: '该业务功能点下已存在相同的系统功能点，不能添加！'
          });
        }
      }, error => {
      });
    },
    /**
     * 添加记录
     */
    addNewRow(row){
      this.reqParams.singleBody = this.deepClone(row);
      this.reqParams.singleBody.id = '';
      this.reqParams.singleBody.bizFunctionNo = this.bizFunctionData.bizFunctionNo;
      this.reqParams.singleBody.bizFunctionName = this.bizFunctionData.bizFunctionName;
      this.reqParams.singleBody.versionNo = this.bizFunctionData.versionNo;
      this.reqParams.singleBody.newVersionNo = this.bizFunctionData.newVersionNo;
      this.reqParams.singleBody.systemFunctionSeq = this.data.length+1;
      this.commonData = reqCommonMsg(this.reqParams)
      saveBizApparchSystemFunction(this.commonData).then(() => {
        this.singleBody={};
        this.onLoad(this.page);
        this.$message({
          type: 'success',
          message: '操作成功!'
        });
      }, error => {
        //this.$console.log(error);
      });         
    },
    
    /**
     * 加载列表数据
     */
    onLoad(page) {
   	  this.singleBody.bizFunctionNo = this.bizFunctionData.bizFunctionNo;
      this.singleBody.versionNo = this.bizFunctionData.versionNo;
      this.orderRules = {
        order: 'ascending',
        prop: 'systemFunctionSeq'
      }
      this.loading = true;
      this.reqParams =  {
        singleBody: this.singleBody,
        listBody: [{}],
        sqlCondition: this.conditions,
        orderRule: this.orderRules,
        currentPage: page.currentPage, 
        pageSize: page.pageSize
      }
      this.commonData = reqCommonMsg(this.reqParams)
      queryBizApparchSystemFunctionListPage(this.commonData).then(res => {
        const data = res.data.body;
        this.page.total = data.total;
        this.data = data.listBody;
        this.loading = false;
        this.selectionClear();
      }, error => {
        this.loading = false;
      });
    },
    /**
     * 新增一条记录
     */
    rowSave(row, done, loading) {
      this.reqParams.singleBody = row;
      // 若拆分到系统，系统功能点名称 == 系统名称
      if(!this.isSplitSystemFunction){
        row.systemFunctionName = row.systemName;
      }
      if(this.selectSystemType == 'outSystem'){
        row.systemNo = row.outSystemNo;
      }
      let formatUser = {};
      this.commonData = reqCommonMsg(this.reqParams)
      saveBizApparchSystemFunction(this.commonData).then(() => {
        done();
        this.singleBody={};
        this.onLoad(this.page);
        this.$message({
          type: 'success',
          message: '操作成功!'
        });
      }, error => {
        //this.$console.log(error);
        done();
      });         
      //this.$console.log("row = ",row ,loading)
    },
    /**
     * 修改一条记录
     */
    rowUpdate(row, index, done, loading) {
      this.reqParams.singleBody = row;
      // 若拆分到系统，系统功能点名称 == 系统名称
      if(!this.isSplitSystemFunction){
        row.systemFunctionName = row.systemName;
      }

      if(this.selectSystemType == 'outSystem'){
        row.systemNo = row.outSystemNo;
      }
      let formatUser = {};
      this.commonData = reqCommonMsg(this.reqParams)
      updateBizApparchSystemFunction(this.commonData).then(() => {
        done();
        this.singleBody={}
        this.onLoad(this.page);
        this.$message({
          type: 'success',
          message: '操作成功!'
        });
      }, error => {
        //this.$console.log(error);
        done();
      });
    },
    /**
     * 删除一条记录
     */
    rowDel(row) {
      this.$confirm('确定将选择数据删除?', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          this.reqParams.singleBody = row;
          this.commonData = reqCommonMsg(this.reqParams);
          return deleteBizApparchSystemFunction(this.commonData);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: 'success',
            message: '操作成功!'
          });
        }).catch(() => {});
    },
    /**
     * 双击打开详细窗口
     */
    handleRowDBLClick (row, event) {
      if(this.permission.biz_apparch_sys_function_dbclick){
        this.$refs.crud.rowView(row,row.$index);
      }
    },
    /**
     * 批量新增记录
     */
    openBatchAddDialog(){
      this.batchAddDialog = true;
    },
    /**
     * 批量导入
     */
    handleImport() {
      const loading = this.$loading({
        lock: true,
        text: '处理中...',
        spinner: 'el-icon-loading',
      });
      var dataList = new Array();
      if(this.importDataArea){
        var lineList = this.importDataArea.split('\n')
        lineList.forEach((element,index) => {
          if(element.trim() != ''){
            var field = element.split('\t')
            var fieldList = {
              bizFunctionNo:field[0].trim(),
              systemFunctionNo:field[1].trim(),
              versionNo:field[2].trim(),
              assetFlag:field[3].trim(),
              systemNo:field[4].trim(),
              systemName:field[5].trim(),
              functionType:field[6].trim(),
              bizFunctionName:field[7].trim(),
              systemFunctionName:field[8].trim(),
              systemFunctionSeq:field[9].trim(),
              isReformFlag:field[10].trim(),
              demandChangeNo:field[11].trim(),
              projectNo:field[12].trim(),
              projectName:field[13].trim(),
              changeDate:field[14].trim(),
              labelInfo:field[15].trim(),
              interfaceFlag:field[16].trim(),
              interfaceNo:field[17].trim(),
              interfaceName:field[18].trim(),
              linkWay:field[19].trim(),
              interactiveType:field[20].trim(),
              serviceSystemNo:field[21].trim(),
              serviceSystemName:field[22].trim(),
              serviceSystemStatus:field[23].trim(),
              serviceSystemFunctionNo:field[24].trim(),
              serviceSystemFunctionName:field[25].trim(),
              serviceInterfaceNo:field[26].trim(),
              serviceInterfaceName:field[27].trim(),
            }
            dataList[index] = fieldList
            //this.$console.log('fieldList = ',fieldList)
          }
        });
        //批量写入记录
        this.reqParams.listBody = dataList;
        this.commonData = reqCommonMsg(this.reqParams)
        saveBizApparchSystemFunctionList(this.commonData).then(() => {
          this.onLoad(this.page);
          this.$message({
            type: 'success',
            message: '操作成功!'
          });
          loading.close();
        }, error => {
          //this.$console.log(error);
          loading.close();
        });      
      }
      else{
        this.loading=false;
        this.$message({
          type: 'warning',
          message: '数据格式不正确!'
        });
      }
    },
    /**
     * 搜索重置
     */
    searchReset() {
      this.conditions =[];
      this.singleBody = {};
      this.onLoad(this.page);
    },
    /**
     * 搜索
     */
    searchChange(params, done) {
      this.singleBody = params
      this.page.currentPage = 1;
      this.onLoad(this.page);
      done();
    },
    refreshChange(){
      this.onLoad(this.page);
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    /**
     * 处理批量删除
     */
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning('请选择至少一条数据');
        return;
      }
      this.$confirm('确定将选择数据删除?', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          this.reqParams.listBody = this.ids;
          this.commonData = reqCommonMsg(this.reqParams);
          return deleteBizApparchSystemFunctionList(this.commonData);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: 'success',
            message: '操作成功!'
          });
          this.$refs.crud.toggleSelection();
        }).catch(() => {});
    },
    /**
     * 拷贝记录
     */
    handleCopy(row){
      this.$confirm('确定复制数据?', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.loading=true;
        let copyValue=row;
        copyValue.id='0';
        copyValue.dataSign='0'
        copyValue.tableName='拷贝 '+ copyValue.tableName; 
        this.reqParams.singleBody = copyValue;
        this.commonData = reqCommonMsg(this.reqParams)
        saveSysToolTables(this.commonData).then(() => {
          this.singleBody={};
          this.onLoad(this.page);
          this.$message({
            type: 'success',
            message: '操作成功!'
          });
          this.loading=false;
        }, error => {
          //this.$console.log(error);
          this.loading=false;
        });
      }).catch(() => {});       
    },
    /**
     * 打开编辑、查询弹窗前查询记录
     */  
    beforeOpen(done, type) {
      if (['edit', 'view'].includes(type)) {
        this.operateType = 'edit';        
        this.reqParams =  {
          singleBody: {
            id:this.form.id
          }
        }
        let commonData = reqCommonMsg(this.reqParams)
        const loading = this.$loading({
          lock: true,
          text: 'Loading',
          spinner: 'el-icon-loading'
        });
        queryBizApparchSystemFunction(commonData).then(res => {
          this.form = res.data.body.singleBody;
          this.form.labelInfo = JSON.parse(this.form.labelInfo);
          setTimeout(() => {
            if(this.form.systemType == 'outSystem'){
              this.form.outSystemNo = this.form.systemNo;
              this.form.systemNo = '';
            }
          }, 500);
          loading.close();
          done();
        }, error => {
          //this.$console.log(error);
          loading.close();
          done();
        });
      }
      if (['add'].includes(type)) {
        this.operateType = 'add';        
        setTimeout(() => {
          this.form.bizFunctionNo = this.bizFunctionData.bizFunctionNo;
          this.form.bizFunctionName = this.bizFunctionData.bizFunctionName;
          this.form.versionNo = this.bizFunctionData.versionNo;
          this.form.newVersionNo = this.bizFunctionData.newVersionNo;
          this.form.systemFunctionSeq = this.data.length+1;
        }, 100);
     	  done();
      }
    },
    /**
     * 翻页查询
     */
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    /**
     * 更改每页条数
     */
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    /**
     * 自定义查询条件
     */
    filterChange(result) {
      this.page.currentPage = 1;
      this.conditions = filterFormat(result)
      this.onLoad(this.page);
    },
    /**
     * 列表排序
     */
    sortChange(val){
      this.orderRules=val
      this.onLoad(this.page);
    },
  
    /**
     * 导出Excel
     */
    exportExcel() {
      this.reqParams =  {
        singleBody: this.singleBody,
        listBody: [{}],
        sqlCondition: this.conditions,
        orderRule: this.orderRules,
        currentPage:1, 
        pageSize: 100
      }
      //this.$console.log('reqParams = ',this.reqParams)
      this.commonData = reqCommonMsg(this.reqParams)
      exportBizApparchSystemFunctionExcel(this.commonData);
    },
    /**
     * 获取业务字典参数
     */
    async getBizDict() {
      let dicData = await this.$params.getBizDict('["systemGrade","functionType","labelType", "sysFuntionlLabelValues","interactiveType","linkWay"]');
      this.findObject(this.option.column, 'systemNo').children.column[0].dicData = dicData.systemGrade;
      this.findObject(this.option.column, 'functionType').dicData = dicData.functionType;
      this.findObject(this.option.column, 'labelInfo').children.column[0].dicData = dicData.labelType;
      this.findObject(this.option.column, 'labelInfo').children.column[1].dicData = dicData.sysFuntionlLabelValues;
      this.findObject(this.option.group[0].column, 'linkWay').dicData = dicData.linkWay;
      this.findObject(this.option.group[0].column, 'interactiveType').dicData = dicData.interactiveType;
    },
    /**
     * 获取应用系统参数
     */
    async getBizParam() {
      // 是否拆分到系统功能点，0-不拆分，不拆分时默认创建业务功能点
      let paramData = await this.$params.getBizParam('["isSplitSystemFunction"]');
      this.isSplitSystemFunction = paramData.isSplitSystemFunction;
      if(!this.isSplitSystemFunction){
        this.findObject(this.option.column, 'systemFunctionName').disabled = true;
        this.findObject(this.option.column, 'systemFunctionName').rules[0].required = false;
        this.findObject(this.option.column, 'functionType').rules[0].required = false;
      }
    },
    /**
     * 调用子组件方法查询历史
     */
    getHistoryRecord () {
      setTimeout(() => {
        this.$refs.historyRecord.getUpdateHistoryRecord(this.form.id);
      })
    },
  },
  created() {
    //如果和项目相关，请打开
    // if(!this.projectInfo || !this.projectInfo.projectName){
    //   this.$message({
    //     type: 'warning',
    //     message: '请选择一个项目再进入！'
    //   });
    //   this.$router.push({path: '/general/project/generalMyProjectSelector'});
    // }       
  },
  mounted() {
    //获取业务字典
    setTimeout(() => {
      this.getBizParam();
      this.getBizDict();
    }, 1000);
    
    //加载机构
    let getOrgTreeTimer = setInterval(() => {
      if(this.genOrgTree){
        let orgTree = [];
        this.genOrgTree.forEach(element => {
          if(element.orgType == '1'){
            orgTree.push(element);
          }
        });
        clearInterval(getOrgTreeTimer);
      }
    }, 100);
  },
  watch: {
    bizFunctionData: {
      handler (val) {
        this.onLoad(this.page);
      },
      deep: true
    }
  }
};
</script>
<style>
.sortClass .avue-crud__menu{
   display: none !important;
 }
.sortClass .avue-crud__pagination{
   padding:5px !important;
   margin: 0px !important;
 }
</style>